program main
    implicit none
    interface
        function cross(a,b)
            implicit none
            real :: a(3),b(3)
            real :: cross(3)
        end function
    end interface
    real :: x(3),y(3)
    x=(/ 1,2,3 /)
    y=(/ 4,5,6 /)
    write(*,*) cross(x,y)
end program

function cross(a,b)
    implicit none
    real :: a(3),b(3)
    real :: cross(3)
    cross(1) = a(2)*b(3)-a(3)*b(2)
    cross(2) = a(3)*b(1)-a(1)*b(3)
    cross(3) = a(1)*b(2)-a(2)*b(1)
end function
